Skip to content

Instantly share code, notes, and snippets.

@thuwyh
thuwyh / approve_readonly_bash.py
Created March 16, 2026 03:11
Claude Code PreToolUse hook: auto-approve read-only Bash commands
#!/usr/bin/env python3
"""Claude Code PreToolUse hook: auto-approve read-only Bash commands.
Deny-first, then allowlist. Unknown commands fall through to user prompt.
Returns JSON with permissionDecision and reason for better diagnostics.
"""
import json
import re
import sys
@MuhammadSaim
MuhammadSaim / rarreg.key
Last active April 2, 2026 02:20
Step 1: Create a file called rarreg.key Step 2: Paste into the file the raw content of this gist Step 3: Go to Winrar install directory (by default => c:\ProgramFiles\WinRAR\ ) Step 4: Paste the rarreg.key into WinRAR directory Step 5: Enjoy
RAR registration data
WinRAR
Unlimited Company License
UID=4b914fb772c8376bf571
6412212250f5711ad072cf351cfa39e2851192daf8a362681bbb1d
cd48da1d14d995f0bbf960fce6cb5ffde62890079861be57638717
7131ced835ed65cc743d9777f2ea71a8e32c7e593cf66794343565
b41bcf56929486b8bcdac33d50ecf773996052598f1f556defffbd
982fbe71e93df6b6346c37a3890f3c7edc65d7f5455470d13d1190
6e6fb824bcf25f155547b5fc41901ad58c0992f570be1cf5608ba9
@sdhalpern86
sdhalpern86 / index.html
Created April 2, 2026 02:18
Apollo/Saturn v Orion/Artemis Missions: Computational & Capabilities Comparison
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Technical Review: Spaceflight Computing</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; 作者: 李继刚
;; 日期: 2025-11-12
;; 剑名: 圆桌讨论
;; 剑意: 构建一个以“求真”为目标的结构化对话框架。该框架由一位极具洞察力的主持人
;; 进行引导,邀请代表不同思想的“典型代表人物”进行一场高强度的、即时响应式的
;; 深度对话。主持人将在每轮总结时生成视觉化的思考框架(ASCII Chart),通过
;; “主动质询” 与“协同共建”,对用户提出的议题进行协同探索,最终生成深刻的、
;; 结构化的知识网络。
@jaxFF
jaxFF / patch_v7.40_5000.1337
Last active April 2, 2026 02:15
Reverse engineered HWiNFO 12-hour shared memory limit patch
>hwinfo64.exe
000000000022005C:3D->90
000000000022005D:00->90
000000000022005E:2E->90
000000000022005F:93->90
0000000000220060:02->90
0000000000220061:0F->E9
0000000000220062:86->81
0000000000220063:80->00
@nup002
nup002 / R&DLabGuide.md
Last active April 2, 2026 02:12
Setting Up a Physics and Electronics R&D Lab

Setting Up a Physics and Electronics R&D Lab

A practitioner's guide based on experience setting up and operating sensor development and characterisation labs at CERN, LBNL, DESY, and the University of Bergen.

Author: Magne Lauritzen

Contact: magne.lauritzen@summacogni.com

The majority of this guide applies to any lab doing experimental physics, electronics development, or instrumentation work. Sensor-specific sections are clearly marked.

@josh-padnick
josh-padnick / README.md
Last active April 2, 2026 02:12
Manually Edit AWS Console "Switch Role" Configuration in Bash

Manually Edit AWS Console "Switch Role" Configuration in Bash

Motivation

At Gruntwork, we work with multiple software teams. That means we have to modify the "Switch Role" history multiple times. But the only way to do that today is to delete your cookie and clear all AWS Console saved settings. That got old after a while, so these instructions enable you to modify the "Switch Roles" configuration directly.

The Big Picture

@Haseeb-Qureshi
Haseeb-Qureshi / claude-code-harness-deep-dive.md
Created March 31, 2026 21:26
Inside the Claude Code source

Inside the Claude Code source

Anthropic's Claude Code CLI source code leaked onto GitHub recently. All of it. About 1,900 files and a lot of TypeScript.

I read through the key modules. What follows is a breakdown of the surprising parts: how the system actually works, where Anthropic made clever engineering choices, and where their approach diverges from OpenAI's Codex in ways you wouldn't guess from using either tool.

Lifecycle of a request

Here's what happens when you type a message into Claude Code:

@namazso
namazso / SuperReturn.c
Last active April 2, 2026 02:11
SuperReturn
/// Return, but across multiple frames.
///
/// This function unwinds the given number of frames, then sets the return value provided, emulating as if this number
/// of functions returned, with the last one returning the value provided in RetVal. Can be used to hook a callee when
/// you don't have a convenient way to hook it directly and actually just want to stub it out with a return value.
///
/// @param FramesToSkip The number of frames to skip, starting from the current frame.
/// @param RetVal The value to return from the last frame.
/// @param Context Context to start from, in case you want to SuperReturn from somewhere deeper.
DECLSPEC_NOINLINE void SuperReturn(